1. Field of the Invention
The present invention relates to an image reading apparatus, a control method therefor, and a program in, for example, a scanner.
2. Description of the Related Art
As an image reading apparatus, there is known a flatbed scanner, which emits by a light source such as an LED within a original platen constituted by a transmitting member, light toward an original document placed on the original platen, and reads reflected light using a sensor such as a CIS. Such an image reading apparatus reads a whole original document by moving the sensor, and outputs a read image as image data.
The flatbed scanner removes the influence of external light using a cover for covering the original platen so that external light is not reflected on an image to be output. An operator, however, needs to close the cover after placing an original document. For this reason, reading many original documents requires considerable time and labor. Furthermore, if an original document placed on the original platen is too thick to close the cover, it is necessary to read the original document with the cover open. If, however, the original document is read with the cover open, a reflection of external light exists in an image to be output which receives the influence of the external light, as shown in FIG. 12. In this case, the image reading apparatus may not be able to correctly detect a document size.
Japanese Patent Laid-Open No. 2007-28413 proposes an image reading apparatus that reduces the influence of external light by using data which has been read line by line by turning on a light source, and data which has been read line by line by turning off the light source. More specifically, Japanese Patent Laid-Open No. 2007-28413 proposes a technique which uses, as a mask pattern, the data that has been read by turning off the light source to perform mask processing on the data which has been read by turning on the light source. With this technique, the image reading apparatus of Japanese Patent Laid-Open No. 2007-28413 reduces the influence of external light experienced when reading an image with the cover closed.
The above conventional technique, however, has the following problems. For example, in the technique described in Japanese Patent Laid-Open No. 2007-28413, it is necessary to read each line twice. It takes, therefore, twice the usual time to perform the reading operation, thereby decreasing the productivity. Furthermore, even if external light is reflected when reading data by turning on an LED, external light is not necessarily reflected on the same place when reading the data by turning off the LED, depending on the flicker of external light, and it may be impossible to correctly remove the reflection of external light.